CVGREYC_PATH = ../../../python-cvgreyc
#CVGREYC_PATH = $(HOME)/Develop/python-cvgreyc
BINARY = load save use reuse loadC saveC useC
CFLAGS = -Wall -ansi -pedantic -g -I$(CVGREYC_PATH)/include
LDFLAGS= -L../ -lrptree

all : $(BINARY)

clean :
	rm *.o
	rm $(BINARY)

load : load.o ../RPTree.o ../RPLeaf.o 
	g++ $^ -o $@ $(CFLAGS)

save : save.o ../RPTree.o ../RPLeaf.o 
	g++ $^ -o $@ $(CFLAGS)

use : use.o ../RPTree.o ../RPLeaf.o 
	g++ $^ -o $@ $(CFLAGS)

reuse : reuse.o ../librptree.so
	g++ reuse.o -o $@ $(CFLAGS) $(LDFLAGS)

loadC : loadC.o ../librptree.so
	g++ loadC.o -o $@ $(CFLAGS) $(LDFLAGS)

saveC : saveC.o ../librptree.so
	g++ saveC.o -o $@ $(CFLAGS) $(LDFLAGS)

useC : useC.o ../librptree.so
	g++ useC.o -o $@ $(CFLAGS) $(LDFLAGS)

%C.o : %.c
	g++ -c $< -o $@ $(CFLAGS)

%.o : %.cpp
	g++ -c $< -o $@ $(CFLAGS)
